package com.pig4cloud.pig.djjk.service.sence;

import cn.hutool.core.util.StrUtil;
import com.wd.ais.domain.dto.*;
import com.wd.ais.service.AisEventsServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class AisService {
    Logger log = LoggerFactory.getLogger(AisService.class);
    @Resource(name = "aisEventsService1")
    AisEventsServiceImpl aisEventsService1;

    public void eventsSub1(String url){
        AisEventSubResponse response = aisEventsService1.eventsSub(new AisEventSubRequest()
                .setEventPush(new AisEventPushRequest().setEventUrl(url)));
        log.info(StrUtil.toString(response));
    }
    public AisEventsListResponse listEvent1(){
        AisEventsListResponse response = aisEventsService1.eventsList();
        log.info(StrUtil.toString(response));
        return response;
    }
    public AisEventUnsubResponse unsubEvent1(String url){
        AisEventUnsubResponse response = aisEventsService1.eventsUnsub(new AisEventUnsubRequest().setEventUrl(url));
        log.info(StrUtil.toString(response));
        return response;
    }


}
